﻿namespace WMS6.Web.CustomizeReport
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class TNTDailyInvRptQuery : BasePage
    {
        protected Button btnSearch;
        protected CheckBox cbxHistory;
        protected DropDownList ddlExpiryDate;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlSkuClass;
        protected DropDownList ddlSkuDescr;
        protected DropDownList ddlSkuGroup;
        protected DropDownList ddlSkuID;
        protected HtmlForm F16010;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlImage img3;
        protected Label lblExpiryDate;
        protected Label lblOwnerID;
        protected Label lblSkuClass;
        protected Label lblSkuDescr;
        protected Label lblSkuGroup;
        protected Label lblSkuID;
        protected HtmlLink mycss;
        protected Label one1;
        protected TextBox txtExpiryDate;
        protected TextBox txtExpiryDate2;
        protected TextBox txtOwnerID;
        protected TextBox txtSkuClass;
        protected TextBox txtSkuDescr;
        protected TextBox txtSkuGroup;
        protected TextBox txtSkuID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("TNTDailyInvRptList.aspx");
        }

        private void InitDDl()
        {
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlSkuClass, 0);
            base.InitQueryDDL(this.ddlSkuID, 0);
            base.InitQueryDDL(this.ddlSkuDescr, 0);
            base.InitQueryDDL(this.ddlSkuGroup, 0);
            base.InitQueryDDL(this.ddlExpiryDate, 1);
            this.cbxHistory.Checked = true;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDDl();
            }
        }

        public string ExpiryDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExpiryDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExpiryDate.Text.Trim(), this.ddlExpiryDate.SelectedValue, this.txtExpiryDate2.Text.Trim(), "ExpiryDate");
                }
                return "";
            }
        }

        public string History
        {
            get
            {
                if (this.cbxHistory.Checked)
                {
                    return "Y";
                }
                return "N";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string SkuClass
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuClass.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuClass.Text.Trim(), this.ddlSkuClass.SelectedValue);
                }
                return "";
            }
        }

        public string SkuDescr
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuDescr.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuDescr.Text.Trim(), this.ddlSkuDescr.SelectedValue);
                }
                return "";
            }
        }

        public string SkuGroup
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuGroup.Text.Trim()))
                {
                    return base.GetParamsString(this.ddlSkuGroup.SelectedValue.Trim(), this.ddlSkuGroup.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuID.Text.Trim(), this.ddlSkuID.SelectedValue);
                }
                return "";
            }
        }
    }
}

